# $Id: PKGBUILD 184186 2013-05-03 10:19:10Z foutrelis $
# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Alessio 'mOLOk' Bolognino <themolok@gmail.com>
# Contributor: shamrok <szamrok@gmail.com>

pkgname=smplayer
pkgver=0.8.4
pkgrel=2
pkgdesc="A complete front-end for MPlayer"
arch=('i686' 'x86_64')
url="http://smplayer.sourceforge.net/"
license=('GPL')
depends=('qt4' 'mplayer')
makedepends=('optipng')
install=smplayer.install
source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2)
md5sums=('4691b569c4209d7e5a2c1386d9319881')

prepare() {
  cd "$pkgname-$pkgver"

  # Fix invalid PNG icons to work with libpng 1.6
  # http://sourceforge.net/p/smplayer/bugs/571/
  find -name '*.png' -exec optipng -quiet -force -fix {} +
}

build() {
  cd "$pkgname-$pkgver"
  sed -i 's:#\(DEFINES += NO_DEBUG_ON_CONSOLE\):\1:' src/smplayer.pro
  make PREFIX=/usr QMAKE=qmake-qt4 LRELEASE=lrelease-qt4
}

package() {
  cd "$pkgname-$pkgver"
  make PREFIX=$pkgdir/usr install
}

